package com.emip.service.impl;

import java.util.Date;
import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.emip.bean.MonthStoreBean;
import com.emip.dao.MonthStoreDAO;
import com.emip.service.MonthStoreService;

@Service("MonthStoreService")
public class MonthStoreServiceImpl implements MonthStoreService {

	@Autowired
	MonthStoreDAO monthStoreDAO;
	
	public List<MonthStoreBean> getByTimespan(int startYear, int startMonth,
			int endYear, int endMonth, String[] itemIds, String siteId) {
		return monthStoreDAO.getByTimespan(startYear, startMonth, endYear, endMonth, itemIds, siteId);
	}

	public MonthStoreBean merge(MonthStoreBean store) {
		return monthStoreDAO.merge(store);
	}

	public String getLastDate(String itemId, String siteId) {
		return monthStoreDAO.getLastDate(itemId, siteId);
	}

	public List<MonthStoreBean> getByTimespan(int startYear, int startMonth,
			int endYear, int endMonth, String[] itemIds, String siteId,
			int page, int size) {
		return monthStoreDAO.getByTimespan(startYear, startMonth, endYear, endMonth, itemIds, siteId, page, size);
	}

	public long getCount(int startYear, int startMonth, int endYear,
			int endMonth, String[] itemIds, String siteId) {
		return monthStoreDAO.getCount(startYear, startMonth, endYear, endMonth, itemIds, siteId);
	}

	public Object[] getStatistics(int startYear, int startMonth, int endYear,
			int endMonth, String itemIds, String siteId) {
		return monthStoreDAO.getStatistics(startYear, startMonth, endYear, endMonth, itemIds, siteId);
	}

	public MonthStoreBean findByMonth(String year, String month, String siteId,
			String itemId) {
		return monthStoreDAO.findByMonth(year, month, siteId, itemId);
	}

}
